package com.whp.circle;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * @author wanghp
 * @version 1.0
 * @date 2020/6/27 18:08
 */
public class B implements BeanNameAware, ApplicationContextAware {
	private A a;
//	public B(A a) {
//		this.a=a;
//	}

	public A getA() {
		return a;
	}

	public void setA(A a) {
		this.a = a;
	}

	@Override
	public void setBeanName(String name) {
		System.out.println(" B -BeanNameAware");
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		System.out.println("B- 后置处理器调用ApplicationContextAware");
	}
}
